package com.action;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.dao.CommonDAO;
import com.dao.SysuserDAO;
import com.model.Familycy;
import com.model.Familyda;
import com.model.Notice;
import com.model.Sysuser;
import com.model.Tjreport;
import com.model.Tzdata;
import com.opensymphony.xwork2.ActionSupport;
import com.util.Info;
import com.util.Pagination;

public class TjrecordAction extends ActionSupport
{
	private Integer id;
	private String bgno;
	private String cyid;
	private String age;
	private String sg;
	private String tz;
	private String sl;
	private String tl;
	private String xy;
	private String hxnote;
	private String ycbnote;
	private String xhxtnote;
	private String ispx;
	private String othernote;
	private String savetime;
	private int index=1;
	String no;
	String suc;
	private String utype;
	private CommonDAO commonDAO;
	private ArrayList<Tzdata> rslist;
	private String xml;
	
	
	public String getSavetime() {
		return savetime;
	}


	public void setSavetime(String savetime) {
		this.savetime = savetime;
	}


	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}


	public String getBgno() {
		return bgno;
	}


	public void setBgno(String bgno) {
		this.bgno = bgno;
	}


	public String getCyid() {
		return cyid;
	}


	public void setCyid(String cyid) {
		this.cyid = cyid;
	}


	public String getAge() {
		return age;
	}


	public void setAge(String age) {
		this.age = age;
	}


	public String getSg() {
		return sg;
	}


	public void setSg(String sg) {
		this.sg = sg;
	}


	public String getTz() {
		return tz;
	}


	public void setTz(String tz) {
		this.tz = tz;
	}


	public String getSl() {
		return sl;
	}


	public void setSl(String sl) {
		this.sl = sl;
	}


	public String getTl() {
		return tl;
	}


	public void setTl(String tl) {
		this.tl = tl;
	}


	public String getXy() {
		return xy;
	}


	public void setXy(String xy) {
		this.xy = xy;
	}


	public String getHxnote() {
		return hxnote;
	}


	public void setHxnote(String hxnote) {
		this.hxnote = hxnote;
	}


	public String getYcbnote() {
		return ycbnote;
	}


	public void setYcbnote(String ycbnote) {
		this.ycbnote = ycbnote;
	}


	public String getXhxtnote() {
		return xhxtnote;
	}


	public void setXhxtnote(String xhxtnote) {
		this.xhxtnote = xhxtnote;
	}


	public String getIspx() {
		return ispx;
	}


	public void setIspx(String ispx) {
		this.ispx = ispx;
	}


	public String getOthernote() {
		return othernote;
	}


	public void setOthernote(String othernote) {
		this.othernote = othernote;
	}


	public int getIndex() {
		return index;
	}


	public void setIndex(int index) {
		this.index = index;
	}


	public String getNo() {
		return no;
	}


	public void setNo(String no) {
		this.no = no;
	}


	public String getSuc() {
		return suc;
	}


	public void setSuc(String suc) {
		this.suc = suc;
	}


	public String getUtype() {
		return utype;
	}


	public void setUtype(String utype) {
		this.utype = utype;
	}


	public CommonDAO getCommonDAO() {
		return commonDAO;
	}


	public void setCommonDAO(CommonDAO commonDAO) {
		this.commonDAO = commonDAO;
	}


	public ArrayList<Tzdata> getRslist() {
		return rslist;
	}


	public void setRslist(ArrayList<Tzdata> rslist) {
		this.rslist = rslist;
	}


	public String getXml() {
		return xml;
	}


	public void setXml(String xml) {
		this.xml = xml;
	}


	//添加
	public String TjrecordAdd(){
		Tjreport tjreport = new Tjreport();
		tjreport.setBgno(Info.getAutoId());
		tjreport.setCyid(cyid);
		tjreport.setAge(age);
		tjreport.setSg(sg);
		tjreport.setTz(tz);
		tjreport.setSl(sl);
		tjreport.setTl(tl);
		tjreport.setXy(xy);
		tjreport.setHxnote(hxnote);
		tjreport.setYcbnote(ycbnote);
		tjreport.setXhxtnote(xhxtnote);
		tjreport.setIspx(ispx);
		tjreport.setOthernote(othernote==null?"":othernote);
		tjreport.setSavetime(Info.getDateStr());
		  		commonDAO.save(tjreport);
				suc="";
			return "success";
	}
	
	public String TjrecordEdit(){
		Tjreport tjreport = (Tjreport)commonDAO.findById(id, "Tjreport");
		tjreport.setAge(age);
		tjreport.setSg(sg);
		tjreport.setTz(tz);
		tjreport.setSl(sl);
		tjreport.setTl(tl);
		tjreport.setXy(xy);
		tjreport.setHxnote(hxnote);
		tjreport.setYcbnote(ycbnote);
		tjreport.setXhxtnote(xhxtnote);
		tjreport.setIspx(ispx);
		tjreport.setOthernote(othernote==null?"":othernote);
		commonDAO.update(tjreport);
		id = id;
		suc="";
		return "success";
	}
	
	
}
